package com.hhkj.admin.conf.common.cont;

import lombok.AllArgsConstructor;
import lombok.Getter;

public class ConfConst {

    @AllArgsConstructor
    @Getter
    public enum EffectiveCode {

        EFFECTIVE("有效的", "effective"),

        INVALID("失效的", "invalid"),

        WAITING("未生效", "waiting");

        private final String name;

        private final String code;
    }

    @AllArgsConstructor
    @Getter
    public enum Code {
        //规则："withDrawalLimit"-提现规则 "receivingAccount"-打款账户 "commissionRate"-分佣规则

        WITHDRAWAL_LIMIT("提现规则", "withdrawalLimit"),

        RECEIVING_ACCOUNT("打款账户", "receivingAccount"),

        COMMISSION_RATE("分佣规则", "commissionRate");

        private final String name;

        private final String code;

        public static Code getByCode(String code) {
            for (Code codeEnum : values()) {
                if (codeEnum.getCode().equals(code)) {
                    return codeEnum;
                }
            }
            return null;
        }
    }
}
